{extend name="_container/add"}

{block name="content"}
<link rel="stylesheet" href="/static/admin/plugin/layuiExtend/modules/css/formSelects.css">
<input type="hidden" name="id" value="{$r.id}">
<div class="layui-form-item" >
    <label class="layui-form-label ">上级用户<span></span></label>
    <div class="layui-input-inline">
        <select lay-ignore name="pid" class="select2" style="width:100%" id="info_pid">
            <option value="">顶级</option>
            {foreach $pid_arr as $v}
            <option value="{$v.id}" {$v.id == $r.pid?'selected':''}>
            ┠
            {for start="1" end="$v.level"}
            --
            {/for}
            {$v.username}
            </option>
            {/foreach}
        </select>
        <div class="description"></div>
    </div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item" style="">
    <label class="layui-form-label">用户名</label>
    <div class="layui-input-inline">
        <input class="layui-input"  name="username" value="{$r.username}">
    </div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item" style="">
    <label class="layui-form-label">密码</label>
    <div class="layui-input-inline">
        <input type="password" class="layui-input"  name="password" value="">
    </div>
    <div class="layui-form-mid layui-word-aux"></div>
</div>

<div class="layui-form-item" style="">
    <label class="layui-form-label">角色选择</label>
    <div class="layui-input-inline">
        <select name="role[ ]" class="select2" lay-ignore multiple style="width: 100%">
            {foreach $roleArr as $role}
            <option value="{$role.id}" {if in_array($role.id, $roles)}selected{/if}>{$role.name}</option>
            {/foreach}
        </select>
    </div>
    <div class="layui-form-mid layui-word-aux">
        {if config('member.role_type')}
        第一个角色为默认登录角色
        {/if}
    </div>
</div>

<div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
        <input type="number" name="sort"  value="{$r.sort?$r.sort:''}"  placeholder="本层级排序" autocomplete="off" class="layui-input">
    </div>
</div>
{/block}

{block name="js"}
<script>
    function save_form3(obj){
        save_form2(obj);
        return false;
    }
</script>
{/block}

{/extend}
